﻿<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <meta charset="utf-8" />
    <script src="../Scripts/jquery-1.11.3.min.js"></script>

    <link href="../Scripts/Cover3.0/Cover3.0.css" rel="stylesheet" />
    <script src="../Scripts/Cover3.0/Cover3.0.js"></script>
    <link href="../Scripts/Uploader6.2/Uploader6.2.css" rel="stylesheet" />
    <script src="../Scripts/Uploader6.2/Uploader6.2.js"></script>
</head>
<body>
    <br /><br /><br />
    <h1>修改弹框默认情况，默认不需要右侧示例</h1>
    <div>
        上传文件名：
        <span id="name"></span>
        <br />
        <img id="relativeName" />
    </div>
    <br /><br /><br />
    <div class="uploader uploader-default" id="uploadBtn"></div>
    <br />
    <br /><br />

    <script>
        /********使用Ajax 方式传输数据***********/
        var uploader = $('#uploadBtn').uploader({
            url: '../ashx/upload_ajax.ashx',
            fileExts: 'jpg;png',
            type: 'dialog',
            text: '剪切图片模式',
            more: false,//是否可以上传多个
            auto: true, //是否自动上传
            coverParams: {
                //showRight:true,//设置是否显示右侧模板
                targetWidth: 200,
                targetHeight:200
            },
            onCheck: function (file) {
                console.info(file);
            },
            onSendImg: function (dataUrl) {
                $('#relativeName').attr('src', dataUrl);
            },
            onSuccess: function (data) {
                console.info(data);
                $('#name').text(data.newName);
                $('#relativeName').attr('src', data.relativeName);
            }
        });
    </script>

</body>
</html>
